<template>
  <el-container>
    <basic-crud v-model="formData" :option="option" businessUrl="/bd/trayController">
    </basic-crud>
  </el-container>
</template>

<script setup>
const formData = ref({})
const option = {
  menuWidth: 180,
  calcHeight: 10,
  column: [
    {
      label: "编号",
      prop: "code",
      search: true,
      minWidth: 100,
      sortable: true,
      rules: [{ required: true, message: "编号不能为空" }],
    },
    {
      label: "名称",
      prop: "name",
      minWidth: 100,
      search: true,
      sortable: true,
      rules: [{ required: true, message: "名称不能为空" }],
    },
    {
      label: "条码",
      prop: "qrCode",
      minWidth: 100,
      search: true,
      sortable: true,
      placeholder: "输入条码的值即可，唯一",
      rules: [{ required: true, message: "条码不能为空" }],
    }, {
      label: "采购日期",
      prop: "buyDate",
      type: "date",
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
    }, {
      label: "失效日期",
      prop: "invalidDate",
      type: "date",
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
    }, {
      label: "责任人",
      prop: 'trayAdminName',
      component: 'BasicCrudTableSelect',
      dataType: 'user',
      width: 150,
      comProps: {
        saveFieldMap: { trayAdminName: 'name', trayAdminId: 'id' },
      },
      curForm: formData,
      change: (newV) => {
        formData.value = newV
      },
    },
    {
      label: "描述",
      type: 'textarea',
      span: 24,
      prop: "des",
      sortable: true,
    },
  ],
}
</script>

<style lang="scss" scoped></style>
